import 'package:finance_app/generated/l10n.dart';

class LanguageUtils {
  static String getLanguageName(String code) {
    switch (code) {
      case 'en':
        return 'English';
        break;
      case 'zh':
        return 'Chinese';
        break;
      default:
        return '';
    }
  }

  static String translateStatus(String text) {
    switch (text) {
      case 'Overdue':
        return S.current.overdue;
      case 'Unpaid':
        return S.current.unpaid;
      case 'Paid':
        return S.current.paid;
      case 'Accepted':
        return S.current.accepted;
      case 'Fully Credited':
        return S.current.fully_credited;
      case 'Credit Available':
        return S.current.credit_available;
      case 'Open':
        return S.current.open;
      case 'Closed':
        return S.current.closed;
      case 'Rejected':
        return S.current.rejected;
      case 'Withdraw':
        return S.current.withdraw;
      case 'Upcoming':
        return S.current.upcoming;
      case 'Pending':
        return S.current.pending;
      case 'Approved':
        return S.current.approved;
      case 'Matched':
        return S.current.matched;
      case 'Unmatched':
        return S.current.unmatched;
      case 'Existing':
        return S.current.existing;
      case 'Left':
        return S.current.left;
      case 'All':
        return S.current.all;
      case 'Inactive':
        return S.current.inactive;
      case 'Active':
        return S.current.active;
      case 'Male':
        return S.current.male;
      case 'Female':
        return S.current.female;
      case 'Expired':
        return S.current.expired;
      case 'Ongoing':
        return S.current.ongoing;

      default:
        return text;
    }
  }

  static String translateFilter(String text) {
    switch (text) {
      //transaction type
      case 'Quotation':
        return S.current.quotation;
      case 'Purchase Order':
        return S.current.purchase_order;
      case 'Bill':
        return S.current.bill;
      case 'Invoice':
        return S.current.invoice;
      case 'Money-In':
        return S.current.money_in;
      case 'Expense':
        return S.current.expense;
      case 'Money-Out':
        return S.current.money_out;
      case 'Credit Note':
        return S.current.credit_note;
      case 'Debit Note':
        return S.current.debit_note;
      case 'Product':
        return S.current.product;
      case 'Service':
        return S.current.service;
      case 'Employee':
        return S.current.employee;
      case 'Payslip':
        return S.current.payslip;
      case 'Journal Entry':
        return S.current.journal_entry;
      case 'Delivery Order':
        return S.current.deliver_order;
      // transaction filter status
      case 'Open':
        return S.current.open;
      case 'Closed':
        return S.current.closed;
      case 'Accepted':
        return S.current.accepted;
      case 'Rejected':
        return S.current.rejected;
      case 'Unpaid':
        return S.current.unpaid;
      case 'Paid':
        return S.current.paid;
      case 'Open PO':
        return S.current.open_po;
      case 'Billed PO':
        return S.current.billed_po;
      case 'Closed PO':
        return S.current.closed_po;
      case 'Unpaid Bill':
        return S.current.unpaid_bill;
      case 'Paid Bill':
        return S.current.paid_bill;
      case 'Fully Credited':
        return S.current.fully_credited;
      case 'Credit Available':
        return S.current.credit_available;
      case 'Unpaid Invoice':
        return S.current.unpaid_invoice;
      case 'Overdue':
        return S.current.overdue;
      case 'Overdue Bill':
        return S.current.overdue_bill;
      case 'Unpaid Expense':
        return S.current.unpaid_expense;
      case 'Overdue Expense':
        return S.current.overdue_expense;
      case 'Paid Expense':
        return S.current.paid_expense;
      //filter contact
      case 'Net Incoming':
        return S.current.net_incoming;
      case 'Net Outgoing':
        return S.current.net_outgoing;
      case 'Overdue Transactions':
        return S.current.overdue_transactions;
      case 'Client':
        return S.current.client;
      case 'Supplier':
        return S.current.supplier;
      //cash and bank
      case 'Account Transfer':
        return S.current.account_transfer;
      // invite team member
      case 'Owner':
        return S.current.owner;
      case 'Manager':
        return S.current.manager;
      case 'Staff':
        return S.current.staff;
      case 'Disable':
        return S.current.disable;
      //SHG
      case 'Statutory Default':
        return S.current.statutory_default;
      case 'Custom Amount':
        return S.current.custom_amount;
      default:
        return text;
    }
  }

  static String translateTag(String tag) {
    switch (tag) {
      case 'PO':
        return S.current.po;
      case 'Bill':
        return S.current.bill;
      case 'Expense':
        return S.current.expense;
      case 'Quotation':
        return S.current.quotation;
      case 'Money-In':
        return S.current.money_in;
      case 'Money-Out':
        return S.current.money_out;
      case 'Invoice':
        return S.current.invoice;
      case 'Transfer':
        return S.current.transfer;
      case 'Transfer In':
        return S.current.transfer_in;
      case 'Transfer Out':
        return S.current.transfer_out;
      case 'Credit \nNote':
        return S.current.credit__note;
      case 'Debit \nNote':
        return S.current.debit__note;
      default:
        return tag;
    }
  }

  static String translateAction(String text) {
    switch (text) {
      //report
      case 'History':
        return S.current.history;
      case 'Mark As Submitted':
        return S.current.mark_as_submitted;
      case 'Record Money-Out':
        return 'Record Money-Out';
      case 'Record Money-In':
        return 'Record Money-In';
      case 'Accept Tax Computation':
        return S.current.accept_tax_computation;
      case 'Add General Journal':
        return 'Add General Journal';
      case 'Add Fixed Asset':
        return S.current.add_fixed_asset;
      case 'Open PDF Report':
        return S.current.open_pdf_report;
      case 'Edit Balance':
        return S.current.edit_balance;
      case 'Undo Reconciliation':
        return S.current.undo_reconciliation;
      case 'Download Excel':
        return S.current.download_excel;
      //common
      case 'Add':
        return S.current.add;
      case 'Edit':
        return S.current.edit;
      case 'Delete':
        return S.current.delete;
      case 'Share':
        return S.current.share;
      case 'Approve':
        return S.current.approve;
      case 'Reject':
        return S.current.reject;
      case 'Withdraw':
        return S.current.withdraw;
      //fixed asset
      case 'Mark As Sold':
        return S.current.mark_as_sold;
      case 'Mark As Disposed':
        return S.current.mark_as_disposed;
      //review photo
      case 'Edit Photo':
        return S.current.edit_photo;
      case 'Retake Photo':
        return S.current.retake_photo;
      case 'Choose Again':
        return S.current.choose_again;
      //bill
      case 'See Payment':
        return S.current.see_payment;
      case 'Make Payment':
        return S.current.make_payment;
      case 'Mark As Delivered':
        return S.current.mark_as_delivered;
      //invoice
      case 'Receive Payment':
        return S.current.receive_payment;
      //purchase order
      case 'Convert To Bill':
        return S.current.convert_to_bill;
      case 'Make A Copy':
        return S.current.make_a_copy;
      case 'Mark As Delivered':
        return S.current.mark_as_delivered;
      case 'See Bill':
        return S.current.see_bill;
      // quotation
      case 'Generate Invoice':
        return S.current.generate_invoice;
      case 'Generate DO':
        return S.current.generate_do;
      //credit note
      case 'Make A Refund':
        return S.current.make_a_refund;
      case 'Keep As Credit':
        return S.current.keep_as_credit;
      //product & service
      case 'Deactivate':
        return S.current.deactivate;
      case 'Activate':
        return S.current.activate;
      case 'Adjust Inventory':
        return S.current.adjust_inventory;
      case 'Return Item':
        return S.current.return_item;
      case 'Stock Adjustment':
        return S.current.stock_adjustment;
      //hr & payroll
      case 'Mark As Resigned':
        return S.current.mark_as_resigned;
      case 'Duplicate As New':
        return S.current.duplicate_as_new;
      case 'Generate Payslip':
        return S.current.generate_payslip;
      case 'Record Payment':
        return S.current.record_payment;
      case 'Apply Leave':
        return S.current.apply_leave;
      case 'Add Expense Claim':
        return S.current.add_expense_claim;
      case 'Leave Adjustment':
        return S.current.leave_adjustment;
      case 'Record CPF Contribution':
        return S.current.record_cpf_contribution;
      case 'Reimburse Now':
        return S.current.reimburse_now;
      case 'Reimburse Later':
        return S.current.reimburse_later;
      //coa
      case 'Set Opening Balance':
        return S.current.set_opening_balance;
      case 'Close Current FY':
        return S.current.close_current_fy;
      //subscription
      case 'Cancel Subscription':
        return S.current.cancel_subscription;
      case 'Manage Default Card':
        return S.current.manage_default_card;
      //role & permission
      case 'Duplicate Role':
        return S.current.duplicate_role;
      case 'Edit Permission':
        return S.current.edit_permission;
      case 'Delete Role':
        return S.current.delete_role;
      case 'Add Role':
        return S.current.add_role;
      default:
        return text;
    }
  }

  static String translateReport(String text) {
    switch (text) {
      case 'Sales By Period':
        return S.current.sales_by_period;
      case 'Sales By Customer':
        return S.current.sales_by_customer;
      case 'Sales By Products / Services':
        return S.current.sales_by_products_services;
      case 'Aged Receivables Summary':
        return S.current.aged_receivables_summary;
      case 'Aged Payables Summary':
        return S.current.aged_payables_summary;
      case 'Aged Receivables Details':
        return S.current.aged_receivables_details;
      case 'Aged Payables Details':
        return S.current.aged_payables_details;
      case 'Purchases By Period':
        return S.current.purchases_by_period;
      case 'Purchases By Supplier':
        return S.current.purchases_by_supplier;
      case 'Purchases By Products / Services':
        return S.current.purchases_by_products_services;
      case 'Aged Payables Summary':
        return S.current.aged_payables_details;
      case 'Aged Payables Details':
        return S.current.aged_payables_details;
      case 'Inventory Valuation Summary':
        return S.current.inventory_valuation_summary;
      case 'Inventory Valuation Details':
        return S.current.inventory_valuation_details;
      case 'GST F5':
        return S.current.gst_f5;
      case 'GST Details':
        return S.current.gst_details;
      case 'Tax Computation':
        return S.current.tax_computation;
      case 'Profit & Loss':
        return S.current.profit__loss;
      case 'Balance Sheet':
        return S.current.balance_sheet;
      case 'Statement of Cash Flows':
        return S.current.statement_of_cash_flows;
      case 'General Ledger':
        return S.current.general_ledger;
      case 'Journal Entries':
        return S.current.journal_entries;
      case 'Bank Reconciliation':
        return S.current.bank_reconciliation;
      case 'Fixed Asset Listings':
        return S.current.fixed_asset_listings;
      case 'Payroll Monthly Summary':
        return S.current.payroll_monthly_summary;
      case 'Edit Balance':
        return S.current.edit_balance;
      case 'Reconciliation Report':
        return S.current.reconciliation_report;
      case 'View Payment':
        return S.current.view_payment;
      case 'View Sales Details':
        return S.current.view_sales_details;
      case 'View Disposal Details':
        return S.current.view_disposal_details;
      case 'Withdraw Leaves':
        return S.current.withdraw_leaves;
      default:
        return text;
    }
  }
}
